package main

import (
	"github.com/google/wire"
	"jk-time/webook/payment/dao"
	"jk-time/webook/payment/grpc"
	"jk-time/webook/payment/ioc"
	"jk-time/webook/payment/repository"
	"jk-time/webook/payment/web"
)

func InitPaymentServiceServer() *App {
	wire.Build(
		ioc.InitDB,
		ioc.InitRedis,
		dao.NewGormPayment,
		repository.NewPaymentRepository,
		web.NewWechatHandler,

		ioc.NewNativePaymentService,
		ioc.InitLogger,
		grpc.NewWechatServiceServer,
		ioc.NewGrpcxServer,
		ioc.InitJobs,
		wire.Struct(new(App), "*"),
	)
	return new(App)
}
